/*
	loadingOverlay.js
	Brandon Kerr, Washington University in St Louis
	04/12/2013

	Meant to allow placement/control of a loading screen/overlay/lightbox
	to any page. Controls/callbacks could be expanded in the future to 
	include calls to cancel the loading and display some menu, etc.
*/

function LoadingOverlay() {
	this.overlayID = 'lo-overlay'
	this.boxID = 'lo-box'

	if ( ! $('#'+this.overlayID)[0] ) {
		$('body')
			.append( '<div id="' + this.overlayID + '"></div>' )
			.append( '<div id="' + this.boxID + '"><span id="lo-title"></span><span id="lo-msg"></span></div>' )
	}
}

LoadingOverlay.prototype.display = function( titleString, msgString ) {
	$('#gecontainer').css({ 'visibility' : 'hidden' })
	$('#'+this.overlayID).toggle()
	$('#'+this.boxID).toggle()
	$('body').css({ 'overflow' : 'hidden' })

	$('#lo-title').html( titleString )
	$('#lo-msg').html( msgString )
}